Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JSON-RPC eth_signTypedData_v4 method to Hardhat Network. #1189

Merged
merged 8 commits into from
Feb 9, 2021

Conversation

scnale
Copy link
Contributor

@scnale scnale commented Jan 20, 2021

This pull request:

  • Adds JSON-RPC method eth_signTypedData_v4 and implements it with signTypedData_v4 of eth-sig-util.
    • Its implementation mimics MetaMask's. It attempts to parse the typed message parameter as a JSON if it is a string.
  • Modifies the JSON-RPC method eth_signTypedData to mark it as not supported.
  • Adds JSON-RPC method eth_signTypedData_v3 and marks it as not supported.
  • Adds method _signTypedData for SignerWithAddress in hardhat-ethers.
  • Adds test in hardhat-ethers for SignerWithAddress._signTypedData.

Context: EIP712 early implementation.

This marks it as unsupported.
This restricts the type of the parameter for the creation of
`SignerWithAddress` to an `ethers.provider.JsonRpcSigner`
instead of an `ethers.Signer`.
@scnale scnale linked an issue Feb 1, 2021 that may be closed by this pull request
@fvictorio fvictorio modified the milestones: hardhat-core@2.0.9, hardhat-ethers@2.0.2 Feb 9, 2021
@fvictorio fvictorio merged commit f604e23 into master Feb 9, 2021
@fvictorio fvictorio deleted the feature/eth-signTypedData-v4 branch February 9, 2021 18:24
jacobrosenthal pushed a commit to jacobrosenthal/hardhat that referenced this pull request Apr 29, 2021
Vanilla `eth_signTypedData` was marked as unsupported in NomicFoundation#1189, in favor of the v4 version. This PR updates the docs to reflect that.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

eth_signTypedData incompatible with ethers _signTypedData signer.signTypedData is not defined.
3 participants